package cn.tkd.client.gold.context;

import cn.tkd.client.gold.model.CrawlNodeDO;

import com.extjs.gxt.ui.client.store.ListStore;

/**
 * @author 嘉陵江里捉鱼 email:tang7259@163.com
 *@version 1.0
 *@time Nov 3, 2008 11:10:30 AM
 */
public class CrawlNodeContext {

	private static ListStore<CrawlNodeDO> list;

	public static ListStore<CrawlNodeDO> getStore() {

		return list;
	}

	public static CrawlNodeDO getAgent(String id) {
		load();
		for (int i = 0; i < list.getCount(); i++) {
			CrawlNodeDO item = list.getAt(i);
			if (item.getId().equalsIgnoreCase(id)) {
				return item;
			}
		}
		return null;
	}

	public static void load() {
		if (list == null) {
			list = new ListStore<CrawlNodeDO>();
			list.add(new CrawlNodeDO("GXEAWJPYPE", "河北"));
			list.add(new CrawlNodeDO("DK3XR3N6WA", "广西"));
			list.add(new CrawlNodeDO("3RS66C1D38", "新疆"));
		}
	}
}
